<?php

/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| Here is where you can register web routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| contains the "web" middleware group. Now create something great!
|
*/

/**
 * 前台
 */
Route::group(['namespace'=>'Web'], function() {
    Route::get('/','SiteController@index');
    Route::get('/fbxr.html','FindController@index');//发布寻人
    Route::post('/dofbxr','FindController@addmsg');
    Route::get('/xrdt/t{typeid}/{pid?}','FindController@xrlist')->where(['typeid'=>'[\d]+','pid'=>'[\d]+']);//寻人大厅
    Route::post('/xrdt','FindController@search');
    Route::get('/xrdt/{id}.html','FindController@detilas')->where('id','[\d]+');
    Route::get('/news/n{id}','NewsController@index')->where('id','[\d]+');//综合资讯
    Route::get('/news/{id}.html','NewsController@detials')->where('id','[\d]+');//详情新闻
    Route::get('/addservice.html','SiteController@addservice');//增值服务
    Route::any('/request.html','SiteController@message');//留言服务
    Route::post('/dorequest','SiteController@addmesage');
    Route::get('/xrtab','FindController@changetab');//首页寻人切换
    Route::get('/indexnews','NewsController@forntinfos');//首页推荐资讯
    Route::get('/sendform.html','SiteController@sendmsgform');//wap页面的留言页面
    Route::get('/aboutus.html','SiteController@aboutus');//wap页面的网站介绍
});

/**
 * 后台
 */
Route::get('/Xlogin','Admin\AdminController@login'); //登录页
Route::post('/Xverify','Admin\AdminController@verifys'); //判断用户

Route::group(['namespace'=>'Admin', 'middleware'=>'adminLogin'], function() {

    Route::get('/Xindex','AdminController@index'); //后台首页
    Route::get('/Xclear','AdminController@cookieClear'); //退出

    //后台用户管理
    Route::any('/Xpwdupdate','AdminController@pwdUpdate'); //修改密码
    Route::any('/XadminUser','AdminController@adminUser'); //用户管理
    Route::post('/Xedituser','AdminController@editUser'); //修改用户
    Route::get('/Xisdelete','AdminController@deleteUser'); //删除用户
    Route::post('/Xadduser','AdminController@adduser'); //添加用户

    //广告位管理
    Route::any('/Xadverts','FrontManageController@adverts');
    Route::post('/XadvertAction','FrontManageController@advertAction');//广告位添加
    Route::post('/XadvertUpdate','FrontManageController@advertUpdate');//广告位修改
    Route::post('/Xisshow','FrontManageController@isShow');//广告位修改
    Route::get('/Xadvertdel','FrontManageController@advertdel');//广告位删除

    //友链管理
    Route::any('/Xchain','FrontManageController@friendChain');
    Route::any('/XchainDel','FrontManageController@chainDel');
    Route::any('/XaddChain','FrontManageController@addChain');
    Route::any('/XeditChain','FrontManageController@editChain');

    //资讯管理
    Route::any('/Xinformation','InformationController@index');
    Route::post('/XinformatUpdate','InformationController@update');
    Route::post('/XinformatAdd','InformationController@addInformat');
    Route::post('/XchangeStatus','InformationController@isRecommend');
    Route::any('/XinformatDel','InformationController@delInformat');

    //留言管理
    Route::any('/Xmessage','MessageController@index'); 
    Route::get('/XmsgDel','MessageController@msgDel'); 

    //寻人管理
    Route::any('/Xfindpeople','FindController@index');
    Route::post('/XfindAdd','FindController@findAdd');
    Route::post('/XfindUpdate','FindController@findUpdate');
    Route::get('/XfindDel','FindController@findDel');
    Route::post('/XfindchangeStatus','FindController@changeStatus');

    //增值服务管理
    Route::any('/Xservice', 'ServiceController@index');
    Route::post('/XserviceAdd', 'ServiceController@serviceAdd');
    Route::post('/XserviceEdit', 'ServiceController@serviceEdit');
    Route::post('/XserviceIsShow', 'ServiceController@isShow');
    Route::get('/XserviceDel', 'ServiceController@servicedel');
});

Route::post('/Uploads','Admin\UploadController@Upload');